package view.micro
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import model.micro.projectiles.Projectile;
	import util.MyMath;
	import util.Settings;
	import view.micro.IMicroSprite;
	
	/**
	 *
	 */
	public class ArrowSprite extends Shape implements IMicroSprite
	{
		private var projectile:Projectile;
		
		public function ArrowSprite(projectile:Projectile)
		{
			this.projectile = projectile;
			graphics.lineStyle(0, 0x332200);
			graphics.lineTo( -Settings.METER / 3, 0);
			alpha = 0.4;
		}
		
		public function update():void
		{
			x = projectile.getX();
			y = projectile.getY();
			
			rotation = MyMath.degrees(Math.atan2(projectile.getYSpeed(), projectile.getXSpeed()));
		}
		
		public function readyToRemove():Boolean
		{
			return projectile.readyToRemove();
		}
		
	}

}